<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    const obj = {
		age:12
    }
	console.log(obj.age || 100);// 12
	console.log(obj.username || "zhangsan");// zhangsan
	console.log(obj.age && 100);// 100
	console.log(obj.username && "zhangsan");// undefined

	console.log(obj.info?.my);

	// ??:当左侧为undefined或null时，输出右侧的值
	console.log(obj.age ?? "lala");
	console.log(obj.username ?? "xixi");
	console.log(null ?? "xixi");
	console.log(1 ?? "xixi");
	console.log(0 ?? "xixi");
</script>
</html>